/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Date;

/**
 * <p>Project: javase - Str5
 * <p>Powered by webrx On 2021-12-06 09:29:45
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Str5 {
    public static void main(String[] args) {
        String str = "      hell    java                 ";
        System.out.println(str);
        System.out.println(str.strip());
        //String[] ss = new String[]{"", "", ""};
        //System.out.println(ss.length);
        System.out.println(str.length());

        //System.out.println(str.trim());
        System.out.println(str.isBlank());//false
        System.out.println("".isBlank());//true
        //是不是空白字符串
        System.out.println("     ".isBlank());//true
        System.out.println("     ".isEmpty());//false

        //java 11 isEmpty() 判断是不是空字符串
        System.out.println("".isEmpty());//true
        System.out.println("".equals(""));//true

        Object d = new Date().toString();
        if (d instanceof java.lang.String) {
            System.out.println("是字符串");
        } else {
            System.out.println("不是String");
        }
    }
}
